import { getAllWsList } from "../runner/wsStore"

export const sendWebSocket = ([type, data]) => {
    const wsList = getAllWsList()
    wsList.forEach(ws => {
        try {
            ws.send(JSON.stringify({ type, data }))
        } catch (error) {
            console.error(error)
        }
    })

}